import request from '@/utils/request';

// 列表
export interface manageList {
    name: string;
    pageNum: number;
    pageSize: number;

    [property: string]: any;
}

export function getManageList(data: manageList) {
    return request({
        url: '/evaluation/management/list',
        method: 'get',
        params: data
    });
}

// 添加
export interface data {
    /**
     * 状态(启用就是传进"是"，禁用就是"否")
     */
    enable: string;
    /**
     * 测评名称
     */
    name: string;

    [property: string]: any;
}

export function addManagement(data: data) {
    return request({
        url: '/evaluation/management/add',
        method: 'post',
        data: data
    });
}

//删除
export function delManagement(ids) {
    return request({
        url: `/evaluation/management/del/${ids}`,
        method: 'delete'
    });
}

//编辑
export interface editData {
    /**
     * 状态
     */
    enable: string;
    id: number;
    /**
     * 测评名
     */
    name: string;

    [property: string]: any;
}

export function editManagement(data:editData) {
    return request({
        url: `/evaluation/management/edit`,
        method: 'put',
        data:data
    });
}
